package group2.model;

import java.sql.Date;

/**
 * 书籍类
 * @author 薛献军
 * @date 2020/8/18 7:26
 */
public class Book {

    private Integer bookId;  //书籍ID
    private String bookName;    //书籍名
    private String bookAuthor;  //作者
    private String bookPress;   //出版社
    private String isbn;        //ISBN
    private Date   publishDate;     //出版日期
    private String img;         //图片
    private String description;     //简介
    private Integer pages;      //页数
    private Integer typeId;     //类型ID
    private Float price;        //原价
    private Float discount;     //打几折
    private Integer stock;      //库存


    //实体映射
   private BookType bookType;

    public Book() {
    }

    public Book(Integer bookId, String bookName, String bookAuthor, String bookPress, String isbn, Date publishDate, String img, String description, Integer pages, Float price, Float discount, Integer stock) {
        this.bookId = bookId;
        this.bookName = bookName;
        this.bookAuthor = bookAuthor;
        this.bookPress = bookPress;
        this.isbn = isbn;
        this.publishDate = publishDate;
        this.img = img;
        this.description = description;
        this.pages = pages;
        this.price = price;
        this.discount = discount;
        this.stock = stock;
    }

    public Integer getBookId() {
        return bookId;
    }

    public void setBookId(Integer bookId) {
        this.bookId = bookId;
    }

    public String getBookName() {
        return bookName;
    }

    public void setBookName(String bookName) {
        this.bookName = bookName;
    }

    public String getBookAuthor() {
        return bookAuthor;
    }

    public void setBookAuthor(String bookAuthor) {
        this.bookAuthor = bookAuthor;
    }

    public String getBookPress() {
        return bookPress;
    }

    public void setBookPress(String bookPress) {
        this.bookPress = bookPress;
    }

    public String getIsbn() {
        return isbn;
    }

    public void setIsbn(String isbn) {
        this.isbn = isbn;
    }

    public Date getPublishDate() {
        return publishDate;
    }

    public void setPublishDate(Date publishDate) {
        this.publishDate = publishDate;
    }

    public String getImg() {
        return img;
    }

    public void setImg(String img) {
        this.img = img;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Integer getPages() {
        return pages;
    }

    public void setPages(Integer pages) {
        this.pages = pages;
    }

    public Integer getTypeId() {
        return typeId;
    }

    public void setTypeId(Integer typeId) {
        this.typeId = typeId;
    }

    public Float getPrice() {
        return price;
    }

    public void setPrice(Float price) {
        this.price = price;
    }

    public Float getDiscount() {
        return discount;
    }

    public void setDiscount(Float discount) {
        this.discount = discount;
    }

    public Integer getStock() {
        return stock;
    }

    public void setStock(Integer stock) {
        this.stock = stock;
    }

    public float getDiscountPrice() {
        return this.price*this.discount;
    }

    public BookType getBookType() {
        return bookType;
    }

    public void setBookType(BookType bookType) {
        this.bookType = bookType;
    }
}
